#include "wait.h"
#include "ui_wait.h"
#include <QDebug>
wait::wait(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::wait)
{
    ui->setupUi(this);
    Inittimer();
    qDebug()<<"调用等待";
}

wait::~wait()
{
    delete ui;
    qDebug()<<"停止等待";
}

void wait::timeshow()
{
    wait_time++;
    ui->label_2->setText(QString::number(wait_time));

}

void wait::Inittimer()
{
    wait_time = 0;
    timer = new QTimer(this);
    connect(timer,SIGNAL(timeout()),this,SLOT(timeshow()));
    timer->start(1000);
}
